package com.library.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 日志类型
 *
 * @author: captian
 * @create: 2023-05-20
 **/

@Getter
@AllArgsConstructor
public enum LogTypeEnum {

    DO_LOG(0, "系统操作"),
    LOGIN_SUCCESS(1, "登录"),
    LOGIN_OUT(2, "登出");

    private Integer code;
    private String desc;


    public static String getValue(Integer code) {
        LogTypeEnum[] logTypeEnums = values();
        for (LogTypeEnum logTypeEnum : logTypeEnums) {
            if (logTypeEnum.getCode().equals(code)) {
                return logTypeEnum.getDesc();
            }
        }
        return null;
    }

}
